clear
%cd ('W:\Projects\Hoffmann_Shcherbakova\Programs_RES')
format('bank');

%%Table 2 
display('     Table 3B: Robustness II - Lagged Small Business Importance')
display('               Panel A ')
display('               mu_k=shapi 50-55 ')
display('               1964-1984')
display('Low shapi')
state_group='Low_Shapi_50_55';
s=1;
T=21;

Main_preparation

M=[ones(size(dgsp)),dy(s:s+T-1,1:K)];
NL=[];


 if ~exist('estimator')
     estimator='OLS';
 end
 if ~exist('channel')
     channel='all';
 end
 
 channel='betaU';
 
Main

display('Middle shapi')
state_group='Middle_Shapi_50_55';

Main_preparation
M=[ones(size(dgsp)),dy(s:s+T-1,1:K)];
Main

display('High shapi')
state_group='High_Shapi_50_55';

Main_preparation
M=[ones(size(dgsp)),dy(s:s+T-1,1:K)];
Main

display('====================================================')
display('               1985-2005')
display('Low shapi')
state_group='Low_Shapi_50_55';
s=22;
T=42;

Main_preparation

M=[ones(size(dgsp)),dy(s:s+T-1,1:K)];

Main

display('Middle shapi')
state_group='Middle_Shapi_50_55';
s=22;
T=42;
Main_preparation
M=[ones(size(dgsp)),dy(s:s+T-1,1:K)];
Main

display('High shapi')
state_group='High_Shapi_50_55';
s=22;
T=42;
Main_preparation
M=[ones(size(dgsp)),dy(s:s+T-1,1:K)];
Main


display('====================================================')
display('====================================================')

display('               Panel B ')
display('               1964-1984')

state_group='all';
s=1;
T=21;
channel='all';
Main_preparation

M=[dy(s:s+T-1,1:K),(ones(T,1)*mean_mu55).*dy(s:s+T-1,1:K),ones(size(dgsp)),(ones(T,1)*mean_mu55)];

Main
display('   ')
display('               1985-2005')

state_group='all';
s=22;
T=42;
channel='all';
Main_preparation

M=[dy(s:s+T-1,1:K),(ones(T,1)*mean_mu55).*dy(s:s+T-1,1:K),ones(size(dgsp)),(ones(T,1)*mean_mu55)];


Main